From fe69ca8ce88b51b0117aebfbb512fef16b4ebb35 Mon Sep 17 00:00:00 2001
From: xuatz <xzlow10@gmail.com>
Date: Thu, 17 Jul 2025 17:24:33 +0900
Subject: feat(mobile): Add user setting for default bookmark view mode (#1723)

* feat(mobile): add user setting for default bookmark view mode

* regen db migration script

* clean up implementation

* Update docs/docs/07-Development/01-setup.md

* Update GEMINI.md

* use local setting instead of storing value in db

* improve start-dev.sh to also handle for db migration

* rename mobileBookmarkClickDefaultViewMode to defaultBookmarkView for consistency
---
 apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

(limited to 'apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx')

diff --git a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
index 00954dd8..eafcfc19 100644
--- a/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
+++ b/apps/mobile/app/dashboard/bookmarks/[slug]/index.tsx
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import { useState } from "react";
 import {
   Alert,
   Keyboard,
@@ -27,6 +27,7 @@ import FullPageSpinner from "@/components/ui/FullPageSpinner";
 import { Input } from "@/components/ui/Input";
 import { useToast } from "@/components/ui/Toast";
 import { useAssetUrl } from "@/lib/hooks";
+import useAppSettings from "@/lib/settings";
 import { api } from "@/lib/trpc";
 import { MenuView } from "@react-native-menu/menu";
 import {
@@ -378,9 +379,11 @@ export default function ListView() {
   const { slug } = useLocalSearchParams();
   const { colorScheme } = useColorScheme();
   const isDark = colorScheme === "dark";
+  const { settings } = useAppSettings();
 
-  const [bookmarkLinkType, setBookmarkLinkType] =
-    useState<BookmarkLinkType>("browser");
+  const [bookmarkLinkType, setBookmarkLinkType] = useState<BookmarkLinkType>(
+    settings.defaultBookmarkView,
+  );
 
   if (typeof slug !== "string") {
     throw new Error("Unexpected param type");
-- 
cgit v1.2.3-70-g09d2

